#pragma once

#include "GrandiaX Mana Egg Table Generator Doc.h"


class CGrandiaXBattleItemView : public CScrollView
{
public: // create from serialization only
	CGrandiaXBattleItemView();
	DECLARE_DYNCREATE(CGrandiaXBattleItemView)

// Attributes
public:
	CGrandiaXManaEggTableGeneratorDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGrandiaXBattleItemView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();

	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CGrandiaXBattleItemView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

    BATTLE_ITEM_DATA BattleItems[30];
    PARTY_DATA PartyData[4];

   	CComboBox Item[30];
    CEdit Count[30];
   	CComboBox Party[4];

    int ItemMap[2001];

    UINT InspectTimer;

    void SetBattleItem(int Slot, int Item, int Count);

// Generated message map functions
protected:

    void UpdateBattleItems();
    void CheckBattleItems();

    void CheckPartyData();

    void StartInspecting();
    void StopInspecting();

    DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnDestroy();
    afx_msg void OnTimer(UINT_PTR nIDEvent);
};

#ifndef _DEBUG  // debug version in GrandiaX Mana Egg Table GeneratorView.cpp
inline CGrandiaXManaEggTableGeneratorDoc* CGrandiaXBattleItemView::GetDocument()
   { return (CGrandiaXManaEggTableGeneratorDoc*)m_pDocument; }
#endif